import {fakeRegister} from './service';

const Model = {
  namespace: 'userRegister',
  state: {
    status: undefined,
  },
  effects: {
    * submit({payload}, {call, put}) {
      const response = yield call(fakeRegister, payload);
      yield put({
        type: 'registerHandle',
        payload: response,
      });
    },
  },
  reducers: {
    registerHandle(state, {payload}) {
      return {...state, status: payload.status};
    },
  },
};
export default Model;
